home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Developer Utilities / Installer 4.0.3 SDK / Script Examples / Install PowerMac [ compressed ] / InstallFatApp.r < prev    next >
Encoding:
Text File  |  1994-09-12  |  43.5 KB  |  1,397 lines  |  [TEXT/MPS ]

  1. //
  2. //    Install Fat App.r
  3. //
  4. //    This install script demonstrates the installation of an application that    
  5. //    can run on a Power Macintosh in Native Mode, a 68000 Macintosh, or both.
  6. //
  7. //    The ability for an application to run under either a PowerMac or 68K machine
  8. //    is referred to as a Fat Application. This decidely untechnical term refers
  9. //    simply to the fact that the application contains more resources than are
  10. //    needed to run on one platform or the other, and is larger than a version
  11. //    of the same application that runs on only a single platform. 
  12. //
  13. //    The main purpose of this installer script is to allow for installation
  14. //    of a Fat Application, or alternatively either the 68K only version, or
  15. //    the PowerMac only version.
  16. //
  17. //    This is easy to accomplish through Easy Install, as the scriptwriter
  18. //    has complete control over what is going to be installed.
  19. //
  20. //    What is not easy to accomplish is the creation of one package in Custom
  21. //    Install, that will install the Fat Application, but has two sub-packages
  22. //    that will install either the 68K only version or the PowerMac only version
  23. //    if selected individually, but install the Fat Application if they are
  24. //    both selected.
  25. //
  26. //    The above described Custom Install scenario has been requested by
  27. //    scriptwriters within Apple and by 3rd party developers as something
  28. //    they would like to be able to do. The specific needs of your project
  29. //    may differ. If the demands of the Custom Install scenario described do
  30. //    not apply to your situation, then your install script may end up being
  31. //    a lot simpler than this example.
  32. //
  33. //    NOTE: Since the original creation of this script three changes have been
  34. //    made. Installation of the PowerMac data fork is now accomplished via
  35. //    InstaCompOne file compression, and the installation of 68K CODE resource 
  36. //    items is now accomplished via InstaCompOne resource compression. A 'vers'
  37. //    resource item has been added to the resource fork of the archive containing
  38. //    the data fork for the PowerMac.
  39. //
  40. //    For simplicity of scripting, all files and resource items that can be
  41. //    installed have been grouped into four categories:
  42. //        1) PowerMac specific stuff
  43. //        2) 68K specific stuff
  44. //        3) Common stuff ( used by either 68K or PowerMac )
  45. //        4) PowerMac Warning on 68K ( used by the PowerMac only version )
  46. //
  47. //    From the applications 'ModApp.Fat' ( which can be found inside the folder
  48. //    'Sources:ModApp.FAT app:' ) and 'NotPPC' ( which can be found 
  49. //    inside the folder 'NotPPC:' ) four files have been created, each file
  50. //     containing the items for one of the above described categories. These
  51. //    four files will be used as the sources for installation.
  52. //
  53. //    To create the four files described above:
  54. //        1) Start with a complete Fat Application
  55. //        2) Remove all CODE resources from the Fat Application
  56. //                and put them in a new ResEdit file
  57. //        3) Save this ResEdit file as "68K Macintosh Part"
  58. //        4) Continue using the modified Fat Application
  59. //        5) Remove all remaining resources, except for the 'cfrg' item
  60. //                and put them in a new ResEdit file
  61. //        6) Save this ResEdit file as "Common Part"
  62. //        7) Rename the modified Fat Application as "Power Macintosh Part" and
  63. //                change it's type and creator to 'rsrc' and 'RSED'.
  64. //                WARNING: The "Power Macintosh Part" must contain the data fork
  65. //                of the original Fat Application, so don't just copy the
  66. //                'cfrg' resource item to a new ResEdit file and save it.
  67. //        8) Copy all the resources from "NotPPC" application
  68. //                into a new ResEdit file.
  69. //        9) Save this ResEdit file  as "PowerMacWarnOn68K Part"
  70. //    
  71. //    NOTE: All the above desribed steps can be accomplished in ResEdit
  72. //    except for the renaming of a file. To rename a file, or create a copy
  73. //    with another name, rename the file or copy from within the Finder. To
  74. //    change the file type and creator, open the file within ResEdit and select
  75. //    "Get Info for <filename>" from the File menu.
  76. //    
  77. //
  78. //    When installing one of the three basic scenarios ( PowerMac, 68K, Fat App ) 
  79. //    install the following groups for each:
  80. //        1) 68K         <= 68K specific stuff,         Common stuff
  81. //        2) PowerMac <= PowerMac specific stuff, Common stuff, PowMac Warn on 68K
  82. //        3) Fat App     <= PowerMac specific stuff, 68K specific stuff, Common stuff
  83. //
  84. //    NOTE: Because of Custom Install design specs ( described earlier ), we have
  85. //    to be a little tricky when designing the PowerMac package to be added to
  86. //    Custom Install. It is necessary to include the "PowerMac Warn on 68K" module 
  87. //     in the PowerMac portion. But we don't know when the PowerMac portion is 
  88. //    selected from Custom Install whether it is part of a complete Fat App 
  89. //    installation or part of a PowerMac only installation.
  90. //
  91. //
  92. //    Contents of each installation source file :
  93. //
  94. //        68K Macintosh Part         
  95. //                -    'CODE' (0) resource item         // CODE for 68K app
  96. //                -    'CODE' (1) resource item         // CODE for 68K app
  97. //                -    'CODE' (2) resource item         // CODE for 68K app
  98. //
  99. //        Power Macintosh Part
  100. //                -     data fork                        // CODE for PowerMac app
  101. //                -    'cfrg' (0) resource item        // describes data fork contents
  102. //
  103. //        Common Part                
  104. //                - This file contains all the resources in the Fat App
  105. //                except for the actual CODE to run the program on either
  106. //                platform ( 68K or PowerMac ), and except for the 'cfrg'
  107. //                resource item from the PowerMac portion.
  108. //                                
  109. //        PowerMac Warning On 68K    
  110. //                -    'CODE' (0) resource item        // 68K CODE for NotPPC alert
  111. //                -    'CODE' (1) resource item        // 68K CODE for NotPPC alert
  112. //                -    'ALRT' (27309) resource item    // rsrc's for NotPPC alert
  113. //                -    'DITL' (27309) resource item    // rsrc's for NotPPC alert
  114. //                -    'STR ' (27309) resource item    // rsrc's for NotPPC alert
  115. //
  116. //    NOTE: In the PowerMac application, the CODE for the program is stored
  117. //        in the DATA fork of the application. In the 68K application, the 
  118. //        CODE for the program is stored in resource items of type 'CODE'.
  119. //        Because the PowerMac CODE is stored in the data fork, we must use 
  120. //        a file atom ( 'infa' ) to handle installation of the CODE to run 
  121. //        the program. Because the 68K CODE is stored in resources, 
  122. //        we can use resource atoms ( 'inra' ) to handle installation.
  123. //
  124. //
  125. //    IMPORTANT: The 68K specific portion of the installation consists entirely
  126. //    of five 'CODE' type resource items, numbered 0 to 4. The "PowerMac Warning
  127. //    on 68K" portion of the installation contains among other things two 'CODE' 
  128. //    type resource items, numbered 0 to 1 ( the same CODE resources that
  129. //    were created as the "NotPPC" code resource ). The sole purpose of the two 
  130. //    'CODE' resource items within "PowerMac Warning on 68K" portion is to provide 
  131. //    an alert when the PowerMac only version of the application is launched on 
  132. //    a 68K system. This alert explains to the user that there's not much of a 
  133. //    chance that the application can run successfully on a 68K system. Special 
  134. //    care needs to be exercized so that the 68K specific 'CODE' resource items 
  135. //    are NEVER replaced by any of the PowerMac specific 'CODE' resource items. 
  136. //
  137. //    Now for the really interesting part. Because of the design spec for Custom
  138. //    Install ( described earlier ), we must take different approaches to the
  139. //    Custom Installation packages depending on whether or not the target 
  140. //    application already exists. Remember that we need to be careful when
  141. //    installing "PowerMac Warning on 68K" CODE resource items, that these
  142. //    resource items never overwrite the 68K CODE resource items.
  143. //
  144. //    If the target application already exists we must use resource atoms 
  145. //    ( 'inra' ) to install the "PowerMac Warning on 68K" CODE resources. 
  146. //    The "keepExisting" flag provided with the resource atom ( 'inra' ) 
  147. //    allows us to prevent resource items from replacing any existing resource 
  148. //    items of the same resource type and resource ID. This will prevent the 
  149. //    "PowerMac Warning on 68K" resource items from replacing 68K code resources.
  150. //
  151. //    If the target application does not already exist we must use 
  152. //    ResMerge ( 'inrm' ) atoms to install the "PowerMac Warning on 68K" 
  153. //    CODE resources. The installer checks before installation to see whether 
  154. //    or not resource items being installed will be replacing existing resources. 
  155. //    If resource items are installed after installation begins, even though we 
  156. //    have told the installer to "keepExisting" resource items, it will overwrite  
  157. //    them if the resource items did not exist before installation began. Using a 
  158. //    ResMerge ( 'inrm' ) atom to handle installation of "PowerMac Warning on 68K"
  159. //    CODE resources will force the "PowerMac Warning on 68K" resource items
  160. //    to be installed before the 68K CODE resources. This is because the
  161. //    68K CODE resource items are installed via resource atoms ( 'inra' ) , 
  162. //    and in this case the "PowerMac Warning on 68K" CODE resource items are 
  163. //    being installed using ResMerge ( 'inrm' ) atoms. ResMerge atoms are always 
  164. //    processed before resource atoms. 
  165. //
  166. //
  167. //    IMPORTANT: It is necessary to place the "PowerMac Warn on 68K"
  168. //    portion file on the first installation disk so that it is assured that
  169. //    the "PowerMac Warn on 68K" portion is processed before the "68K" portion.
  170. //    This is only necessary for the case where the target application does not
  171. //    already exist, but we have no way of knowing whether this condition will
  172. //    exist or not at the time that the installation script is written.
  173. //
  174. //    Because we must take different approaches ( depending on whether or not
  175. //    the target application already exists ) to installing the PowerMac
  176. //    portion of the application under Custom Install, we must load different
  177. //    packages into the list that the user can select from in Custom Install.
  178. //    Each package provides installation of the Fat Application, with subpackages
  179. //    allowing the user to select either the 68K only version, the PowerMac only
  180. //    version, or both. The difference between the Custom Install packages is
  181. //    whether ResMerge ( 'inrm' ) or resource atoms ( 'inra' ) were used to install 
  182. //    the "PowerMac Warning on 68K" CODE resources.
  183. //
  184. //
  185. //    When installing the PowerMac CODE that is stored in the data fork, it is
  186. //    necessary to use a file atom ( 'infa' ) to copy over the data fork into
  187. //    the target application. Note that the file atom we use specifies that
  188. //    the resource fork will not be replaced in the existing target application,
  189. //     if any, through the setting of the flag 'noRsrcFork'.
  190. //
  191. //
  192. //    When installing the "Common Part", it's okay to always overwrite the existing
  193. //    resource items. This allows us to use the resource merge atom ( 'inrm' ). 
  194. //    Resource merge atoms take all the resource items from the resource fork of
  195. //    the source file and "merge" those resources into the resource fork of a 
  196. //    new or existing target file. Resource merge atoms do not, however, allow
  197. //    specification of flags to control installation. Resource merge atoms 
  198. //    always overwrite resource items that have the same resource type and ID.
  199. //
  200. //
  201. //
  202. //     Layout and description of files contained within this example folder :
  203. //
  204. //    Main folder :
  205. //
  206. //        Install Fat App.r            - source script ( .r ) for installation
  207. //
  208. //        Makefile                    - MPW script that creates finished install 
  209. //                                        script from the source script ( .r )
  210. //
  211. //        Install Fat App                - finished installation script
  212. //
  213. //        Install Fat App w/ Debugger    - finished installation script containing 
  214. //                                      debugger information
  215. //
  216. //        Wasabi Debugger Log File    - text file containing results from last
  217. //                                      installation run with debugger
  218. //
  219. //        CheckIfInternalRuleFunc        - code resource that is called within
  220. //                                      install script during installation
  221. //                                      to check if selected target volume
  222. //                                      is internal hard disk ( building of
  223. //                                      this code resource is automated
  224. //                                      within the Makefile )
  225. //
  226. //        CheckIfInternalRuleFunc.SYM - symbols file used for running
  227. //                                      code resource in SADE debugger
  228. //
  229. //        CheckIfInternalRuleFunc.c.o - object file created by compiling
  230. //                                      CheckIfInternalRuleFunc.c
  231. //                                      
  232. //        CheckIfInternalRuleFunc.c     - source file used to create 
  233. //                                      compiled code resource
  234. //
  235. //
  236. //    ModApp Parts :
  237. //
  238. //        68K Macintosh Part            - 68K specific portion of application
  239. //
  240. //        Power Macintosh Part        - PowerMac specific portion of application
  241. //
  242. //        Common Part                    - portion necessary for either machine type
  243. //
  244. //    NOTE on ModApp Parts - these files are not automatically created by the
  245. //    makefile for 'Install Fat App'. The scriptwriter should prepare similiar
  246. //    modules for their project by taking a finished copy of a Fat Application
  247. //    and copying and pasting the correct resource items into the three files.
  248. //
  249. //
  250. //        ModApp.Fat                - application that supports either 68K or
  251. //                                PowerMac Native Mode. This file is not
  252. //                                included in the installation, but is used
  253. //                                as the source for the three files listed
  254. //                                in 'Source Files'. The various 68K
  255. //                                specific parts are cut and copied into 
  256. //                                '68K Macintosh Part', the PowerMac specific
  257. //                                stuff is cut and copied into 'Power Mac part', 
  258. //                                and everything remaining is copied into 
  259. //                                'Common Part'. In addition the two resource 
  260. //                                items 'CODE' (0) and (1)  from 'NotPPC' are 
  261. //                                copied into 'Power Mac Part'.
  262. //
  263. //
  264. //    NotPPC :
  265. //
  266. //        NotPPC                    - module containing the two 'CODE' resource
  267. //                                items that will provide an alert when the
  268. //                                PowerMac only version is launched on 68K.
  269. //
  270. //        NotPPC ReadMe            - explains the NotPPC files and functionality
  271. //
  272. //        NotPPC.c                - source for NotPPC module
  273. //
  274. //        NotPPC.h                - defines for NotPPC.c
  275. //    
  276. //        NotPPC.make                - makefile for NotPPC module
  277. //
  278. //        NotPPC.o                - object file for NotPPC module
  279. //
  280. //        NotPPC.r                - resource definitions for NotPPC module
  281. //
  282. //
  283. //    NOTE on NotPPC    - this module is not automatically created by the makefile
  284. //    that generates the finished installer script. The main reason for this is
  285. //    that the NotPPC module is a standardized method for dealing with the situation
  286. //    where the user attempts to launch a PowerMac application on the 68K platform.
  287. //    Scriptwriters should not need to make any changes to this module. If you wish
  288. //    to make any changes, simply set the current directory for MPW to ':NotPPC:'
  289. //    and run the makefile to build a new version of 'NotPPC' code resource. 
  290. //    Be sure to copy the two 'CODE' resources (0) and (1) into the file
  291. //    'PowerMacWarnOn68K Part' in the 'Source Files' folder.
  292. //    
  293. //
  294. //    Other Considerations:
  295. //
  296. //    - it is simpler to split the 68K and PowerMac CODE resources into two
  297. //    different source files, because these CODE resources occupy the same
  298. //    resource type and ID in the installed application.
  299. //
  300. //    - often times a Fat Application cannot fit onto a single installation
  301. //    disk, and splitting the Fat Application into it's "logical" pieces
  302. //    is a convenient way to split the file
  303. //
  304. //    - splitting the Fat Application allows us to create a simpler method
  305. //    for creating a variety of target applications, such as 68K only,
  306. //    PowerMac only, and a full Fat Application version.
  307. //
  308. //    - splitting the Fat Application also allows us to use less space on the
  309. //    installation disks, then would be taken if we included three full and distinct
  310. //    versions on the installation disks.
  311. //
  312. //
  313. //
  314. //        mark young • 08/20/94
  315. //
  316. //        Copyright 1993-1994, Apple Computer, Inc., All Rights Reserved
  317. //
  318.  
  319. /************************** 
  320.  
  321.  
  322. // Easy Install Package List:
  323.  
  324.     • pick the first applicable case
  325.     
  326.     Target already exists as Fat Application:
  327.         - install Full Fat Application ( update )
  328.     
  329.     Target already exists as 68K version on PowerMac:
  330.         - install Full Fat Application ( update )
  331.     
  332.     Target already exists as PowerMac version on 68K:
  333.         - install Full Fat Application ( update )
  334.     
  335.     Target already exists, and target volume is an external drive:
  336.         - install Full Fat Application ( update )
  337.     
  338.     Target volume is an external drive:
  339.         - install Full Fat Application ( install )
  340.     
  341.     Target machine is a 68K:
  342.         - install 68K Application
  343.     
  344.     Target machine is a PowerMac:
  345.         - install PowerMac Application ( update )
  346.     
  347.     Otherwise:
  348.         - display error that "machine must be 68K or PowerMac"
  349.     
  350.     NOTE: This last case ( Otherwise ) is actually not needed since
  351.     the only time it would be evoked is when the machine being installed
  352.     to is not a 68K or PowerMac. But if the user managed to get the installer
  353.     application to launch on a TRS-80, the user would get a cool error message.
  354.     
  355.  
  356. // Custom Install Package List:
  357.  
  358.     • pick the first applicable case
  359.  
  360.     Target already exists:
  361.  
  362.         - add update full fat app package
  363.  
  364.         // includes the following two subpackages as selectable options
  365.         
  366.         "Demo Application for 68K Macintosh"
  367.         "Demo Application for Power Macintosh" ( update )
  368.  
  369.     Otherwise:
  370.  
  371.         - add install full fat app package
  372.  
  373.         // includes the following two subpackages as selectable options
  374.         
  375.         "Demo Application for 68K Macintosh"
  376.         "Demo Application for Power Macintosh" ( install )
  377.  
  378.  
  379. **********************************/
  380.  
  381.  
  382. include "CheckIfInternalRuleFunc";
  383.  
  384. #include "InstallerTypes.r"
  385.  
  386. // include the InstaCompOne atom extender stuff
  387. // making sure not to add their version resource
  388. // to our installer script
  389. include ":::InstaCompOne 1.0:InstaCompOneAtomExt.rsrc" NOT 'vers';
  390.  
  391. #define currentReleaseDate        -1470076096        
  392. #define currentVersion            0x01008000
  393.  
  394.  
  395. /********************* Easy Install Rule resources *****************************/
  396.  
  397.  
  398. // • Rule function code resource ( 'inrf' )
  399.  
  400. // This code resource, which must be referenced from within a call by
  401. // checkRuleFunction{} within a rule clause, returns true if the 
  402. // selected target volume for the installation has a SCSI ID# of 0,
  403. // otherwise it returns false. This, in effect, is a check to see
  404. // if the selected target volume is the internal drive of the machine
  405. // being installed onto.
  406. #define kCheckIfInternalDriveUFID    9000
  407.  
  408.  
  409. // • Values for checkGestalt rule clause
  410.  
  411. #define gestaltSystemType            'sysa'             // processor type
  412. #define gestalt68Ksysa                1                // 68000 designator
  413. #define gestaltPPCsysa                2                // PowerMac designator
  414.  
  415. // • assertions
  416.  
  417. // NOTE: Assertions are simply a technique for eliminating repetitive 
  418. // condition checks, as well as clarifying rule frameworks. Checks
  419. // are made once and assertions are set. Those assertions are checked
  420. // later within rule clauses, which then take action based on the 
  421. // conditions found earlier.
  422.  
  423. // NOTE: Just defining an assertion does not set that assertion. To set an
  424. // assertion you must call AddAssertion{} from within a rule clause.
  425.  
  426. #define kUpdatingTargetFile            701
  427. #define kUpdating68Kpart            702
  428. #define kUpdatingPowerMacPart        703
  429. #define kTgtVolIsInternalDrive        704
  430. #define kTgtVolIsExternalDrive        705
  431.  
  432. // • constants for packages and atoms
  433.  
  434. #define    kInstallFullFatApp            30000    // used for package
  435. #define    kUpdateFullFatApp            30001    // used for package
  436. #define    kOverWrite68KApp            30002    // used for package
  437. #define    kUpdatePowerMacApp            30003    // used for package
  438. #define    kInstallPowerMacApp            30004    // used for package
  439. #define    kDeleteFullApp                30005    // used for package
  440.  
  441. #define    kCommonStuff                30006    // used for package and atoms
  442. #define    k68KStuff                    30007    // used for package and atoms
  443. #define    kPowerMacStuff                30008    // used for package
  444.  
  445. #define    kInstallPowMacWarnOn68K        30009    // used for package
  446. #define    kUpdatePowMacWarnOn68K        30010    // used for package
  447. #define    kAddPowerMacTo68KApp        30011    // used for package
  448.  
  449. #define    kPowerMacFileAtom            30012    // used for file atom
  450. #define    kPowerMacRsrcAtom            30013    // used for rsrc atom    
  451.  
  452. // • Rule frameworks
  453.  
  454. // • Global framework
  455.  
  456. resource 'infr' (kGlobalFrameworkRsrcID) {
  457.     format0  {{
  458.         // run through all these rule clauses
  459.         pickAll,    { 701, 702, 703, 704, 705 },
  460.     }};
  461. };
  462.  
  463. // if target file exists, set assertion kUpdatingTargetFile
  464. resource 'inrl' (701, "Check if target file already exists") {
  465.     format0 {{
  466.         CheckFileRsrcForkExists { 10000 },
  467.         AddAssertion {{ kUpdatingTargetFile }}
  468.     }};
  469. };
  470.  
  471. // if 68K version exists, set assertion kUpdating68Kpart
  472. resource 'inrl' (702, "Check if 68K version already exists") {
  473.     format0 {{
  474.         CheckAllAssertions {{ kUpdatingTargetFile }},
  475.         CheckFileContainsRsrcByID { 10000, 'CODE', 2 },
  476.         AddAssertion {{ kUpdating68Kpart }}
  477.     }};
  478. };
  479.  
  480. // if PowerMac version exists, set assertion kUpdatingPowerMacPart
  481. resource 'inrl' (703, "Check if PowerMac version already exists") {
  482.     format0 {{
  483.         CheckAllAssertions {{ kUpdatingTargetFile }},
  484.         CheckFileContainsRsrcByID { 10000, 'cfrg', 0 },
  485.         AddAssertion {{ kUpdatingPowerMacPart }}
  486.     }};
  487. };
  488.  
  489. // if target volume is external drive, set assertion kTgtVolIsInternalDrive
  490. resource 'inrl' (704, "Check if installing to internal volume") {
  491.     format0 {{
  492.         checkRuleFunction { kCheckIfInternalDriveUFID },
  493.         AddAssertion {{ kTgtVolIsInternalDrive }}
  494.     }};
  495. };
  496.  
  497. // if target volume is external drive, set assertion kTgtVolIsExternalDrive
  498. resource 'inrl' (705, "Check if installing to external volume") {
  499.     format0 {{
  500.         CheckAnyNonAssertion {{ kTgtVolIsInternalDrive }},
  501.         AddAssertion {{ kTgtVolIsExternalDrive }}
  502.     }};
  503. };
  504.  
  505.  
  506. // • Easy Install framework
  507.  
  508. resource 'infr' (kEasyInstallFrameworkRsrcID) {
  509.     format0  {{
  510.         // pick the first true rule clause and
  511.         // add the appropriate package to Easy Install
  512.         pickFirst,    { 800, 801, 802, 803, 804, 805, 806, 807 },
  513.         }};
  514.     };
  515.  
  516. // if target file exists already, and
  517. // target file supports 68K and PowerMac,
  518. // add 68K and PowerMac packages and description to Easy Install
  519. // • this option is for updating an existing target application
  520. resource 'inrl' (800, "Check if updating FAT") {
  521.     format0 {{
  522.         CheckAllAssertions {{ kUpdating68Kpart, kUpdatingPowerMacPart }},
  523.         addUserDescription {"Click Install button to install\n" },
  524.         addUserDescription {"  • Demo Application for Any Macintosh\n"},
  525.         addPackages {{ kUpdateFullFatApp }}
  526.         }};
  527.     };
  528.  
  529. // if target file exists already, and
  530. // target file supports 68K but NOT Native Mode, and
  531. // target system is a PowerMac,
  532. // add 68K and PowerMac packages and description to Easy Install
  533. // • this option is for updating an existing target application
  534. resource 'inrl' (801, "Check if updating 68K version to a PowerMac") {
  535.     format0 {{
  536.         CheckAllAssertions {{ kUpdating68Kpart }},
  537.         checkGestalt {gestaltSystemType, { gestaltPPCsysa } },
  538.         addUserDescription {"Click Install button to install\n" },
  539.         addUserDescription {"  • Demo Application for Any Macintosh\n"},
  540.         addPackages {{ kUpdateFullFatApp }}
  541.         }};
  542.     };
  543.  
  544. // if target file exists already, and
  545. // target file supports Native Mode but NOT 68K, and
  546. // target system is a 68K,
  547. // add 68K and PowerMac packages and description to Easy Install
  548. // • this option is for updating an existing target application
  549. resource 'inrl' (802, "Check if updating PowerMac version to a 68K") {
  550.     format0 {{
  551.         CheckAllAssertions {{ kUpdatingPowerMacPart }},
  552.         checkGestalt { gestaltSystemType, { gestalt68Ksysa } },
  553.         addUserDescription {"Click Install button to install\n" },
  554.         addUserDescription {"  • Demo Application for Any Macintosh\n" },
  555.         addPackages {{ kUpdateFullFatApp }}
  556.         }};
  557.     };
  558.  
  559. // if target file exists already, and
  560. // installation is being performed to an external drive,
  561. // add 68K and PowerMac packages and description to Easy Install
  562. // • this option is for updating an existing target application
  563. resource 'inrl' (803, "Check if installing to an external drive") {
  564.     format0 {{
  565.         CheckAllAssertions {{ kUpdatingTargetFile }},
  566.         CheckAllAssertions {{ kTgtVolIsExternalDrive }},
  567.         addUserDescription {"Click Install button to install\n" },
  568.         addUserDescription {"  • Demo Application for Any Macintosh\n" },
  569.         addPackages {{ kUpdateFullFatApp }}
  570.         }};
  571.     };
  572.  
  573. // if target file does not exist already, and
  574. // installation is being performed to an external drive,
  575. // add 68K and PowerMac packages and description to Easy Install
  576. resource 'inrl' (804, "Check if installing to an external drive") {
  577.     format0 {{
  578.         CheckAllAssertions {{ kTgtVolIsExternalDrive }},
  579.         addUserDescription {"Click Install button to install\n" },
  580.         addUserDescription {"  • Demo Application for Any Macintosh\n" },
  581.         addPackages {{ kInstallFullFatApp }}
  582.         }};
  583.     };
  584.  
  585. // if target machine is a 68K,
  586. // add full 68K application package and description to Easy Install
  587. resource 'inrl' (805, "Check if installing to a 68K machine") {
  588.     format0 {{
  589.         checkGestalt { gestaltSystemType, { gestalt68Ksysa } },
  590.         addUserDescription {"Click Install button to install\n" },
  591.         addUserDescription {"  • Demo Application for your 68K Macintosh\n" },
  592.         addPackages {{ kOverWrite68KApp }}
  593.         }};
  594.     };
  595.  
  596. // if target machine is a PowerMac,
  597. // add full PowerMac application package and description to Easy Install
  598. resource 'inrl' (806, "Check if PowerMac machine") {
  599.     format0 {{
  600.         checkGestalt { gestaltSystemType, { gestaltPPCsysa } },
  601.         addUserDescription {"Click Install button to install\n" },
  602.         addUserDescription {"  • Demo Application for your Power Macintosh\n" },
  603.         addPackages {{ kUpdatePowerMacApp }}
  604.         }};
  605.     };
  606.  
  607. // if none of the other rule clauses in this set were satisfied
  608. // • this rule should never fire, but it's there just in case !!
  609. resource 'inrl' (807, "Otherwise handle as Fat App") {
  610.     format0 {{
  611.         ReportSysError {"Target System must be a 68K or PowerMac "
  612.                         "for installation."},
  613.         }};
  614.     };
  615.  
  616.  
  617. /******************* Custom Install Rule resources ***************************/
  618.  
  619. // • Custom Install framework
  620.  
  621. resource 'infr' (kCustomInstallFrameworkRsrcID) {
  622.     format0  {{
  623.         // pick the first true rule clause and
  624.         // add the appropriate package to Custom Install
  625.         pickFirst,    { 901, 902 },
  626.     }};
  627. };
  628.  
  629. // add package with all items to Custom Install for existing target app
  630. resource 'inrl' (901, "Add Custom Selection for Existing Target Application") {
  631.     format0 {{
  632.  
  633.         // only do this rule if target app already exists
  634.         CheckAllAssertions {{ kUpdatingTargetFile }},
  635.         
  636.         // contains all three choices for installing app from Custom Install
  637.         // but uses resource atoms ( 'inra' ) to handle installation of the
  638.         // "PowerMac Warning on 68K" CODE resource items ( see intro for info )
  639.         addCustomItems {{ kUpdateFullFatApp }}    
  640.         
  641.         }};
  642.     };
  643.  
  644. // add package with all items to Custom Install for new target app
  645. resource 'inrl' (902, "Add Custom Selection for New Target Application") {
  646.     format0 {{
  647.  
  648.         // contains all three choices for installing app from Custom Install
  649.         // but uses ResMerge atoms ( 'inrm' ) to handle installation of the
  650.         // "PowerMac Warning on 68K" CODE resource items ( see intro for info )
  651.         addCustomItems {{ kInstallFullFatApp }}    
  652.         
  653.         }};
  654.     };
  655.  
  656. /********************* Packages resources *****************************/
  657.  
  658. // Package for Demo App as fat app
  659. // this option is to be used when the target application is already present
  660. // • this package is one of the two main Custom Install packages
  661. resource 'inpk' ( kUpdateFullFatApp ) {
  662.     format0 {
  663.         showsOnCustom, removable, dontForceRestart,
  664.         kUpdateFullFatApp, 0, "Demo Application for Any Macintosh ( update )",
  665.             {
  666.             //  Delete entire file ( Custom Removal only )
  667.             'inpk', kDeleteFullApp,            
  668.  
  669.             //  68K part ( always overwrite )
  670.             'inpk', kOverWrite68KApp,        
  671.             
  672.             //  PowerMac part ( always overwrite )
  673.             'inpk', kUpdatePowerMacApp,    
  674.             
  675.             // NOTE: although the packages for 68K and PowerMac
  676.             // both include the common resources package, the
  677.             // common resources package will only be added once
  678.             // to the list of packages to be installed.
  679.             }
  680.         }
  681.     };
  682.  
  683. // Package for Demo App as fat app
  684. // this option is to be used when the target application is not already present
  685. // • this package is one of the two main Custom Install packages
  686. resource 'inpk' ( kInstallFullFatApp ) {
  687.     format0 {
  688.         showsOnCustom, removable, dontForceRestart,
  689.         kInstallFullFatApp, 0, "Demo Application for Any Macintosh ( install )",
  690.             {
  691.             //  Delete entire file ( Custom Removal only )
  692.             'inpk', kDeleteFullApp,            
  693.  
  694.             //  68K part ( always overwrite )
  695.             'inpk', kOverWrite68KApp,        
  696.             
  697.             //  PowerMac part ( always overwrite )
  698.             'inpk', kInstallPowerMacApp,    
  699.             
  700.             // NOTE: although the packages for 68K and PowerMac
  701.             // both include the common resources package, the
  702.             // common resources package will only be added once
  703.             // to the list of packages to be installed.
  704.             }
  705.         }
  706.     };
  707.  
  708. // Package for Demo App for 68K only via resource atoms
  709. resource 'inpk' ( kOverWrite68KApp ) {
  710.     format0 {
  711.         showsOnCustom, notRemovable, dontForceRestart,
  712.         kOverWrite68KApp, 0, "Demo Application for 68K Macintosh",
  713.             {    
  714.             // Common Resource fork ( always overwrite )
  715.             'inpk', kCommonStuff,    
  716.             
  717.             // 68K Macintosh CODE Resources
  718.             // this option utilizes 'inra' atoms that will always
  719.             // overwrite the target resource items 
  720.             'inpk', k68KStuff,    
  721.             }
  722.         }
  723.     };
  724.  
  725. // Package to Update Demo App for PowerMac
  726. // this option is to be used when the target application is already present
  727. resource 'inpk' ( kUpdatePowerMacApp ) {
  728.     format0 {
  729.         showsOnCustom, notRemovable, dontForceRestart,
  730.         kUpdatePowerMacApp, 0, "Demo Application for Power Macintosh",
  731.             {    
  732.             // Common resources    ( always overwrite )
  733.             'inpk', kCommonStuff,    
  734.  
  735.             // PowerMac Data Fork and resources ( always overwrite )
  736.             'inpk', kPowerMacStuff,    
  737.             
  738.             // PowerMac warning when launched on 68K ( never overwrite )
  739.             'inpk', kUpdatePowMacWarnOn68K,    
  740.             // has to be inra so it doesn't overwrite existing stuff
  741.                             
  742.             }
  743.         }
  744.     };
  745.  
  746. // Package to Install Demo App for PowerMac
  747. // this option is to be used when the target application is not already present
  748. resource 'inpk' ( kInstallPowerMacApp ) {
  749.     format0 {
  750.         showsOnCustom, notRemovable, dontForceRestart,
  751.         kUpdatePowerMacApp, 0, "Demo Application for Power Macintosh",
  752.             {    
  753.             // Common resources    ( always overwrite )
  754.             'inpk', kCommonStuff,    
  755.  
  756.             // PowerMac Data Fork and resources ( always overwrite )
  757.             'inpk', kPowerMacStuff,    
  758.             
  759.             // PowerMac warning when launched on 68K ( never overwrite )
  760.             // has to be inrm so it goes first, at this point we don't know
  761.             // whether both the PowerMac and 68K versions will be installed
  762.             // or if only the PowerMac version is going to be installed. This
  763.             // comes from the design specification that both the 68K and PowerMac
  764.             // only versions will be presented as subpackages of the Fat App
  765.             // under Custom Install. 
  766.             'inpk', kInstallPowMacWarnOn68K,    
  767.             }
  768.         }
  769.     };
  770.  
  771. // Package to add PowerMac version to 68K version
  772. resource 'inpk' ( kAddPowerMacTo68KApp ) {
  773.     format0 {
  774.         doesntShowOnCustom, removable, dontForceRestart,
  775.         0, 0, "Package to add PowerMac support to 68K application",
  776.             {    
  777.             // Common resources    ( always overwrite )
  778.             'inpk', kCommonStuff,    
  779.  
  780.             // PowerMac Data Fork and resources ( always overwrite )
  781.             'inpk', kPowerMacStuff,
  782.             }
  783.         }
  784.     };
  785.  
  786. // Sub-Package to DELETE entire app, whether 68K or PowerMac
  787. resource 'inpk' ( kDeleteFullApp ) {
  788.     format0 {
  789.         doesntShowOnCustom, removable, dontForceRestart,
  790.         0, 0, "Package to delete the demo app",
  791.             {    
  792.             // Delete entire file on Custom Removal
  793.             'infa', kDeleteFullApp,        
  794.             }
  795.         }
  796.     };
  797.  
  798. // Sub-Package of Common Resources
  799. resource 'inpk' ( kCommonStuff ) {
  800.     format0 {
  801.         doesntShowOnCustom, notRemovable, dontForceRestart,
  802.         0, 0, "Sub-Package of Common Resources",
  803.             {    
  804.             //  Common Resources ( always overwrite )
  805.             'inrm', kCommonStuff,    
  806.             }
  807.         }
  808.     };
  809.  
  810. // Sub-Package of 68K specific resources
  811. resource 'inpk' ( k68KStuff ) {
  812.     format0 {
  813.         doesntShowOnCustom, notRemovable, dontForceRestart,
  814.         0, 0, "Package for 68K Macintosh",
  815.             {    
  816.             // 68K Macintosh CODE Resources ( always overwrite )
  817.             'inra', 500,    
  818.             'inra', 501,    
  819.             'inra', 502    
  820.             }
  821.         }
  822.     };
  823.  
  824. // Sub-Package of PowerMac warning when launched on 68K
  825. // • this option is to be used when the target application is not already present
  826. resource 'inpk' ( kInstallPowMacWarnOn68K ) {
  827.     format0 {
  828.         doesntShowOnCustom, notRemovable, dontForceRestart,
  829.         0, 0, "Package for Power Macintosh warning on 68K",
  830.             {    
  831.             'inrm', 400,    // PowerMac Warning stuff
  832.             }
  833.         }
  834.     };
  835.  
  836. // Sub-Package of PowerMac warning when launched on 68K
  837. // • this option is to be used when the target application is already present
  838. resource 'inpk' ( kUpdatePowMacWarnOn68K ) {
  839.     format0 {
  840.         doesntShowOnCustom, notRemovable, dontForceRestart,
  841.         0, 0, "Package for Power Macintosh warning on 68K",
  842.             {    
  843.             'inra', 600,    // PowerMac Warning stuff
  844.             'inra', 601,    // PowerMac Warning stuff
  845.             'inra', 602,    // PowerMac Warning stuff
  846.             'inra', 603,    // PowerMac Warning stuff
  847.             'inra', 604,    // PowerMac Warning stuff
  848.             }
  849.         }
  850.     };
  851.  
  852. // Sub-Package of PowerMac data fork and PowerMac specific resources
  853. resource 'inpk' ( kPowerMacStuff ) {
  854.     format0 {
  855.         doesntShowOnCustom, notRemovable, dontForceRestart,
  856.         0, 0, "Package for Power Macintosh",
  857.             {    
  858.             // Power Macintosh Data Fork ( always overwrite )
  859.             'infa', kPowerMacFileAtom,    
  860.             
  861.             // 'cfrg' resource detailing contents of code in data fork
  862.             'inra', kPowerMacRsrcAtom,
  863.             
  864.             // NOTE: Because we have chosen to specify that the resource
  865.             // fork will not be replaced when installing the kPowerMacStuff
  866.             // file atom ( by setting 'noRsrcFork' in the atom ) we must
  867.             // install the one resource item for 'cfrg' with a seperate
  868.             // resource atom.
  869.             }
  870.         }
  871.     };
  872.  
  873.  
  874. // package comment for Fat application ( pre-4.0 package comments )
  875. resource 'icmt' ( kUpdateFullFatApp ) {
  876.     currentReleaseDate, currentVersion, 30000,
  877.     "This contains the Demo Application, which can be run on any Macintosh."
  878.     };
  879.  
  880. // package comment for Fat application ( pre-4.0 package comments )
  881. resource 'icmt' ( kInstallFullFatApp ) {
  882.     currentReleaseDate, currentVersion, 30000,
  883.     "This contains the Demo Application, which can be run on any Macintosh."
  884.     };
  885.  
  886. // package comment for 68K application ( pre-4.0 package comments )
  887. resource 'icmt' ( kOverWrite68KApp ) {
  888.     currentReleaseDate, currentVersion, 30000,
  889.     "This contains the Demo Application for use on 68K Macintosh."
  890.     };
  891.  
  892. // package comment for PowerMac application ( pre-4.0 package comments )
  893. resource 'icmt' ( kUpdatePowerMacApp ) {
  894.     currentReleaseDate, currentVersion, 30000,
  895.     "This contains the Demo Application for use on Power Macintosh."
  896.     };
  897.  
  898. // just a good old application icon
  899. // to be included in the package comment resources above
  900. data 'ICON' (30000) {
  901.     $"0001 0000 0002 8000 0004 4000 0008 2000"
  902.     $"0010 1000 0020 0800 0040 0400 0080 0200"
  903.     $"0100 0100 0200 0080 0400 0040 0800 0020"
  904.     $"1000 0010 2000 0008 4000 3F04 8000 4082"
  905.     $"4000 8041 2001 3022 1001 C814 080E 7F8F"
  906.     $"0402 3007 0201 0007 0100 8007 0080 6007"
  907.     $"0040 1FE7 0020 021F 0010 0407 0008 0800"
  908.     $"0004 1000 0002 2000 0001 4000 0000 8000"
  909.     };
  910.  
  911.  
  912. /************************** Atoms resources **********************************/
  913.  
  914.  
  915. // ResMerge Atom to install common resources
  916. resource 'inrm' ( kCommonStuff ) {
  917.     format0 {
  918.         0,                // Total size of resources
  919.                         // ( filled in by ScriptCheck if 0 )
  920.                         
  921.         10000,            // Target File Spec
  922.         
  923.         20001,            // Source File Spec 
  924.                         // Demo App Parts:Common Part
  925.                         
  926.         "Installing Common Resources"
  927.     }
  928. };
  929.  
  930. // ResMerge Atom to install 68K CODE resources
  931. resource 'inrm' ( k68KStuff ) {
  932.     format0 {
  933.         0,                // Total size of resources
  934.                         // ( filled in by ScriptCheck if 0 )
  935.                         
  936.         10000,            // Target File Spec
  937.         
  938.         20004,            // Source File Spec
  939.                         // Demo App Parts:68K Part
  940.         ""
  941.     }
  942. };
  943.  
  944. // "PowerMac Warn on 68K" resource items
  945. resource 'inrm' (400) {
  946.     format0 {
  947.         0,                // Total size of resources
  948.                         // ( filled in by ScriptCheck if 0 )
  949.                         
  950.         10000,            // Target File Spec
  951.         
  952.         20004,            // Source File Spec 
  953.                         // Demo App Parts:PowerMacWarnOn68K Part
  954.                         
  955.         ""
  956.     }
  957. };
  958.  
  959. // This File Atom deletes the entire file on removals
  960. resource 'infa' ( kDeleteFullApp ) {
  961.     format1 {
  962.         deleteWhenRemoving,                // make sure atom is included on removal
  963.         dontDeleteWhenInstalling,        // ignore atom during installs
  964.         dontCopy,                        // ignore atom during installs
  965.         dontIgnoreLockedFile,            // don't remove a locked file
  966.         
  967.         dontSetFileLocked,                // ignored during removals
  968.         useSrcCrDateToCompare,            // ignored during removals
  969.         srcNeedExist,                    // ignored during removals
  970.         rsrcForkInRsrcFork,
  971.         leaveAloneIfNewer,                // ignored during removals
  972.         updateExisting,                 // ignored during removals
  973.         copyIfNewOrUpdate,                // ignored during removals
  974.         
  975.         rsrcFork,                        // remove resource fork
  976.         dataFork,                        // remove data fork
  977.         0,
  978.         0,
  979.         10000,                            // target spec for removal
  980.         {    0, 0, 0    },                    // no source spec needed for removal
  981.         0x0,
  982.         0,
  983.         0,
  984.         ""
  985.     }
  986. };
  987.  
  988.  
  989.  
  990. // Installs PowerMac Native Mode RISC code contained in data fork
  991. // NOTE: this does NOT overwrite existing resource fork !!
  992. // • uses InstaCompOne decompression from file archive
  993. resource 'infa' ( kPowerMacFileAtom ) {
  994.     format1 {
  995.         dontDeleteWhenRemoving,
  996.         dontDeleteWhenInstalling,
  997.         copy,
  998.         dontIgnoreLockedFile,
  999.         dontSetFileLocked,
  1000.         useVersProcToCompare,    
  1001.         srcNeedExist,
  1002.         rsrcForkInDataFork,                // InstaCompOne file compression
  1003.                                         // always put rsrc's in data fork
  1004.         leaveAloneIfNewer,
  1005.         updateExisting,
  1006.         copyIfNewOrUpdate,
  1007.         
  1008.         noRsrcFork,                        // because this flag is set
  1009.                                         // to 'noRsrcFork' this atom
  1010.                                         // will not disturb resource
  1011.                                         // fork of target file
  1012.         dataFork,
  1013.         0,                                
  1014.         
  1015.         0x2000+0x0040,                    // finder attribute flags - when copying
  1016.                                         // a bona fide file, ScriptCheck can set
  1017.                                         // this value. But since we copying
  1018.                                         // the data fork from a file that is not
  1019.                                         // the original application, we must set
  1020.                                         // these Finder attributes manually
  1021.                                         
  1022.         10000,                            // target spec for install
  1023.         {    20005,                         // source spec for install
  1024.             0, 
  1025.             0    
  1026.         },
  1027.         0x01008000,                        // version number 1.0
  1028.         
  1029.                                         // WARNING: It is probably best
  1030.                                         // to include a 'vers' resource
  1031.                                         // of ID (1) or (2) in the archive
  1032.                                         // file containing the data fork
  1033.                                         // for PowerMac so that version 
  1034.                                         // comparison to existing file will
  1035.                                         // be performed correctly. A non-zero
  1036.                                         // value for the version field should
  1037.                                         // not be updated by ScriptCheck, but
  1038.                                         // ScriptCheck 4.0.3 seems to update
  1039.                                         // this field no matter what. Use the
  1040.                                         // 'vers' resource from the Common Part
  1041.                                         // and paste it into the file archive.
  1042.         0,                                
  1043.         241,                            // InstaCompOne atom extender ID                                
  1044.         
  1045.         ""                                // atom description
  1046.     }
  1047. };
  1048.  
  1049.  
  1050. // PowerMac 'cfrg' resource item
  1051. resource 'inra' ( kPowerMacRsrcAtom ) {
  1052.     format1 {
  1053.         dontDeleteWhenRemoving,
  1054.         dontDeleteWhenInstalling,
  1055.         copy,
  1056.         leaveAloneIfNewer,
  1057.         noTgtRequired,
  1058.         updateExisting,
  1059.         copyIfNewOrUpdate,
  1060.         ignoreProtection,
  1061.         srcNeedExist,
  1062.         byID,
  1063.         nameNeedNotMatch,
  1064.         0,
  1065.         10000,
  1066.         'cfrg',
  1067.         0,
  1068.         0x0,
  1069.         "",
  1070.         {    20003, 'cfrg', 0, 0, ""    },
  1071.         0x0,
  1072.         0,
  1073.         0,
  1074.         ""
  1075.         }
  1076.     };
  1077.  
  1078. // "PowerMac Warn on 68K" resource item
  1079. resource 'inra' (600) {
  1080.     format1 {
  1081.         dontDeleteWhenRemoving,
  1082.         dontDeleteWhenInstalling,
  1083.         copy,
  1084.         leaveAloneIfNewer,
  1085.         noTgtRequired,
  1086.         keepExisting,
  1087.         copyIfNewOrUpdate,
  1088.         ignoreProtection,
  1089.         srcNeedExist,
  1090.         byID,
  1091.         nameNeedNotMatch,
  1092.         0,
  1093.         10000,
  1094.         'CODE',
  1095.         0,
  1096.         0x0,
  1097.         "",
  1098.         {    20004, 'CODE', 0, 0, ""    },
  1099.         0x0,
  1100.         0,
  1101.         0,
  1102.         ""
  1103.         }
  1104.     };
  1105.  
  1106. // "PowerMac Warn on 68K" resource item
  1107. resource 'inra' (601) {
  1108.     format1 {
  1109.         dontDeleteWhenRemoving,
  1110.         dontDeleteWhenInstalling,
  1111.         copy,
  1112.         leaveAloneIfNewer,
  1113.         noTgtRequired,
  1114.         keepExisting,
  1115.         copyIfNewOrUpdate,
  1116.         ignoreProtection,
  1117.         srcNeedExist,
  1118.         byID,
  1119.         nameNeedNotMatch,
  1120.         0,
  1121.         10000,
  1122.         'CODE',
  1123.         1,
  1124.         0x0,
  1125.         "",
  1126.         {    20004, 'CODE', 1, 0, ""    },
  1127.         0x0,
  1128.         0,
  1129.         0,
  1130.         ""
  1131.         }
  1132.     };
  1133.  
  1134. // "PowerMac Warn on 68K" resource item
  1135. resource 'inra' (602) {
  1136.     format1 {
  1137.         dontDeleteWhenRemoving,
  1138.         dontDeleteWhenInstalling,
  1139.         copy,
  1140.         leaveAloneIfNewer,
  1141.         noTgtRequired,
  1142.         keepExisting,
  1143.         copyIfNewOrUpdate,
  1144.         ignoreProtection,
  1145.         srcNeedExist,
  1146.         byID,
  1147.         nameNeedNotMatch,
  1148.         0,
  1149.         10000,
  1150.         'ALRT',
  1151.         27309,
  1152.         0x0,
  1153.         "",
  1154.         {    20004, 'ALRT', 27309, 0, ""    },
  1155.         0x0,
  1156.         0,
  1157.         0,
  1158.         ""
  1159.         }
  1160.     };
  1161.  
  1162. // "PowerMac Warn on 68K" resource item
  1163. resource 'inra' (603) {
  1164.     format1 {
  1165.         dontDeleteWhenRemoving,
  1166.         dontDeleteWhenInstalling,
  1167.         copy,
  1168.         leaveAloneIfNewer,
  1169.         noTgtRequired,
  1170.         keepExisting,
  1171.         copyIfNewOrUpdate,
  1172.         ignoreProtection,
  1173.         srcNeedExist,
  1174.         byID,
  1175.         nameNeedNotMatch,
  1176.         0,
  1177.         10000,
  1178.         'DITL',
  1179.         27309,
  1180.         0x0,
  1181.         "",
  1182.         {    20004, 'DITL', 27309, 0, ""    },
  1183.         0x0,
  1184.         0,
  1185.         0,
  1186.         ""
  1187.         }
  1188.     };
  1189.  
  1190. // "PowerMac Warn on 68K" resource item
  1191. resource 'inra' (604) {
  1192.     format1 {
  1193.         dontDeleteWhenRemoving,
  1194.         dontDeleteWhenInstalling,
  1195.         copy,
  1196.         leaveAloneIfNewer,
  1197.         noTgtRequired,
  1198.         keepExisting,
  1199.         copyIfNewOrUpdate,
  1200.         ignoreProtection,
  1201.         srcNeedExist,
  1202.         byID,
  1203.         nameNeedNotMatch,
  1204.         0,
  1205.         10000,
  1206.         'STR ',
  1207.         27309,
  1208.         0x0,
  1209.         "",
  1210.         {    20004, 'STR ', 27309, 0, ""    },
  1211.         0x0,
  1212.         0,
  1213.         0,
  1214.         ""
  1215.         }
  1216.     };
  1217.  
  1218. // 68K CODE resource item
  1219. resource 'inra' (500) {
  1220.     format1 {
  1221.         dontDeleteWhenRemoving,
  1222.         deleteWhenInstalling,
  1223.         copy,
  1224.         leaveAloneIfNewer,
  1225.         noTgtRequired,
  1226.         updateExisting,
  1227.         copyIfNewOrUpdate,
  1228.         ignoreProtection,
  1229.         srcNeedExist,
  1230.         byID,
  1231.         nameNeedNotMatch,
  1232.         0,
  1233.         10000,
  1234.         'CODE',
  1235.         0,
  1236.         0x0,
  1237.         "",
  1238.         {    20002, 'part', 0, 0, ""    },
  1239.         0x0,
  1240.         0,
  1241.         241,
  1242.         ""
  1243.         }
  1244.     };
  1245.  
  1246. // 68K CODE resource item
  1247. resource 'inra' (501) {
  1248.     format1 {
  1249.         dontDeleteWhenRemoving,
  1250.         deleteWhenInstalling,
  1251.         copy,
  1252.         leaveAloneIfNewer,
  1253.         noTgtRequired,
  1254.         updateExisting,
  1255.         copyIfNewOrUpdate,
  1256.         ignoreProtection,
  1257.         srcNeedExist,
  1258.         byID,
  1259.         nameNeedNotMatch,
  1260.         0,
  1261.         10000,
  1262.         'CODE',
  1263.         1,
  1264.         0x0,
  1265.         "",
  1266.         {    20002, 'part', 1, 0, ""    },
  1267.         0x0,
  1268.         0,
  1269.         241,
  1270.         ""
  1271.         }
  1272.     };
  1273.  
  1274. // 68K CODE resource item
  1275. resource 'inra' (502) {
  1276.     format1 {
  1277.         dontDeleteWhenRemoving,
  1278.         deleteWhenInstalling,
  1279.         copy,
  1280.         leaveAloneIfNewer,
  1281.         noTgtRequired,
  1282.         updateExisting,
  1283.         copyIfNewOrUpdate,
  1284.         ignoreProtection,
  1285.         srcNeedExist,
  1286.         byID,
  1287.         nameNeedNotMatch,
  1288.         0,
  1289.         10000,
  1290.         'CODE',
  1291.         2,
  1292.         0x0,
  1293.         "",
  1294.         {    20002, 'part', 2, 0, ""    },
  1295.         0x0,
  1296.         0,
  1297.         241,
  1298.         ""
  1299.         }
  1300.     };
  1301.  
  1302.  
  1303. /********************* Target File Spec. resources *****************************/
  1304.  
  1305. // target spec for all the various incarnations of application
  1306. resource 'intf' (10000) {
  1307.     format1 {
  1308.         noSearchForFile,                     // use default search path
  1309.         TypeCrNeedNotMatch,                 // target TYPE,CREATOR need not match
  1310.         'APPL',                             // target TYPE ( ignored, see above )
  1311.         'moda',                             // target CREATOR ( ignored, see above )
  1312.         0x2000+0x0040,                         // finder attribute flags
  1313.         1,                                      // creation date for new file
  1314.         1,                                      // modification date for new file
  1315.         0,                                     // search proc ID ( 'insp' )
  1316.         
  1317.         "folder-user:ModApp"                 // path to target file
  1318.                                             // NOTE: The filename contained
  1319.                                             // in the path to target file is
  1320.                                             // used as the filename to extract
  1321.                                             // from an archive when InstaCompOne
  1322.                                             // is called from within a file atom
  1323.                                             // and this 'intf' is used. This same
  1324.                                             // filename must be used when compressing 
  1325.                                             // the file into the archive ( makefile ).
  1326.         }
  1327.     };
  1328.  
  1329.  
  1330. /********************* Source File Spec. resources *****************************/
  1331.  
  1332. resource 'infs' (20001) {
  1333.     'rsrc', 'RSED', 0x1, noSearchForFile, TypeCrMustMatch,
  1334.     "Disk 1:Common Part"
  1335.     };
  1336.  
  1337. // NOTE: The type for resource archives is 'ircp' ( installer resource compression )
  1338. resource 'infs' (20002) {
  1339.     'ircp', 'kakc', 0x1, noSearchForFile, TypeCrMustMatch,
  1340.     "Disk 1:68KRsrcArchive"
  1341.     };
  1342.  
  1343. resource 'infs' (20003) {
  1344.     'rsrc', 'RSED', 0x1, noSearchForFile, TypeCrMustMatch,
  1345.     "Disk 1:Power Macintosh Part"
  1346.     };
  1347.  
  1348. // NOTE: The type for file archives is 'idcp' ( installer data compression )
  1349. resource 'infs' (20005) {
  1350.     'idcp', 'kakc', 0x1, noSearchForFile, TypeCrMustMatch,
  1351.     "Disk 1:PowMacFileArchive"
  1352.     };
  1353.  
  1354. resource 'infs' (20004) {
  1355.     'rsrc', 'RSED', 0x1, noSearchForFile, TypeCrMustMatch,
  1356.     "Disk 1:PowerMacWarnOn68K Part"
  1357.     };
  1358.  
  1359.  
  1360.  
  1361. resource 'inrf' (kCheckIfInternalDriveUFID) {
  1362.     format0 {
  1363.         userFunctionType,        // code resource type
  1364.         143,                    // code resource ID
  1365.         0,                        // refCon 
  1366.         
  1367.         0,                        // use installer's heap, 
  1368.                                 // instead of a seperate subheap
  1369.         
  1370.         "This Rule Function returns TRUE if the target volume has SCSI ID = 0."
  1371.         }
  1372.     };
  1373.  
  1374. //     The preferenece resource allows that script writer to specify 
  1375. //    certain attributes of the Installer's interface and actions.  
  1376. //    This resource is the default if the script writer does not provide one.
  1377. resource 'inpr' (300) {
  1378.     format0 {
  1379.         useFolderTargetMode,            // allow user to select target folder
  1380.         dontAllowUserToSetSystemDisk,    // we're not installing to system folder
  1381.         showSelectedSizeInCustom,
  1382.         noSetupFunctionSupplied,
  1383.         dontAllowCleanInstall,
  1384.         dontAllowServerAsTarget,
  1385.         0,
  1386.         0,
  1387.             {    
  1388.             301, 311, 301, 311,
  1389.             302, 312, 302, 312
  1390.             },
  1391.         "Demo Application Folder"
  1392.         }
  1393.     };
  1394.  
  1395.  
  1396.  
  1397.